package com.yellowpage.ca.dao;

import java.util.List;

import com.yellowpage.ca.data.FuncModule;
import com.yellowpage.ca.data.RoleFunction;
import com.yellowpage.white.dao.BaseDaoHibernateImpl;

public class RoleFunctionModuleDaoImpl extends BaseDaoHibernateImpl<RoleFunction, Long> implements RoleFunctionModuleDao {

	public RoleFunctionModuleDaoImpl() {
		super(RoleFunction.class);
	}

	public List<FuncModule> searchFunctionModuleByRoleId(Long roleId) {
		String hql = "select fm from FuncModule fm inner join fm.roles fr where fr.roleId = " + roleId + "";
		List list = getHibernateTemplate().find(hql);
		if(list.isEmpty()){
			return list;
		}
		return list;
	}

}
